1. Field of the invention
The present invention relates to an information processing apparatus on which a plurality of applications run in a single process, a control method therefor, and a storage medium.
2. Description of the Related Art
Today, in order to realize solutions, more and more multifunction peripherals (MFPs) have a function of executing applications other than the functions built therein, such as copying, scanning and printing of documents. Many MFPs utilize a Java (registered trademark) execution environment as an application execution environment, and are capable of executing applications written in Java. One example of the application execution environment is Canon's MEAP. On a PC, one Java application is executed in one process. On the other hand, on many MFPs, a plurality of applications are executed in one Java process using an OSGi framework and the like because of CPU and memory limitations. For this reason, when a memory leak has occurred for one of the applications being executed on an MFP due to the presence of a bug therein, there is a possibility that the OutOfMemoryError occurs and all applications shut down.
The OutOfMemoryError occurs when no memory is allocable upon memory request by an application. That is to say, the OutOfMemoryError could occur during execution of trouble-free applications, thus making it difficult to identify an application for which a memory leak has occurred. The following two methods have been used to detect a memory leak. The first method is to monitor the states of objects generated by applications using a tool called a profiler. The second method is to analyze objects generated by applications by dumping out toe contents of a heap memory used by a Java VM (hereinafter referred to as a heap dump). Japanese Patent Laid-Open No. 2009-193511 suggests that, when core dump processing cannot be executed, the core dump processing be realized via connection to an attachable/detachable storage device.
However, the above conventional techniques have the following problems. For example, monitoring of the states of objects using a profiler drastically decreases the execution speed of applications, and is therefore difficult to apply to MFPs with significant CPU and memory limitations. Meanwhile, a conventional heap dump is manually executed at an arbitrary timing. This makes it difficult to dump out the contents of a heap memory immediately before the occurrence of the OutOfMemoryError, that is to say, at a timing most appropriate for the identification of an application for which a memory leak has occurred.